ML pattern match compilation and partial evaluation
نویسنده
چکیده
We derive a compiler for ML style pattern matches It is conceptu ally simple and produces reasonably good compiled matches The derivation is inspired by the instrumentation and partial evaluation of na ve string match ers Following that paradigm we rst present a general and na ve ML pattern matcher instrument it to collect and exploit extra information and show that partial evaluation of the instrumented general matcher with respect to a given match produces an e cient specialized matcher We then discard the partial evaluator and show that a match compiler can be obtained just by slightly modifying the instrumented general matcher The resulting match compiler is interesting in its own right and naturally detects inexhaustive matches and redundant match rules
منابع مشابه
MK Pattern Match Compilation and Partial Evaluation
We derive a compiler for ML-style pattern matches. It is conceptually simple and produces reasonably good compiled matches. The derivation is inspired by the instrumentation and partial evaluation of na ve string match-ers. Following that paradigm, we rst present a general and na ve ML pattern matcher, instrument it to collect and exploit extra information, and show that partial evaluation of t...
متن کاملWhen Do Match-Compilation Heuristics Matter?
Modern, statically typed, functional languages define functions by pattern matching. Although pattern matching is defined in terms of sequential checking of a value against one pattern after another, real implementations translate patterns into automata that can test a value against many patterns at once. Decision trees are popular automata. The cost of using a decision tree is related to its s...
متن کاملSemantics - Directed Compilation of Non - Linear Patterns 1 Olivier
This paper describes the automatic derivation of compiled patterns and of a pattern compiler by partial evaluation. Compiling a pattern is achieved by specializing a pattern matching program with respect to the pattern. Generating a pattern compiler is achieved by specializing the specializer with respect to the pattern matching program, i.e., by self-applying the partial evaluator. The compile...
متن کاملParallel Object Instruction Scheduler
We describe an approach to parallel compilation that seeks to harness the vast amount of ne-grain parallelism that is exposed through partial evaluation of numerically-intensive scientiic programs. We have constructed a compiler for the Supercomputer Toolkit parallel processor that uses partial evaluation to break down data abstractions and program structure, producing huge basic blocks that co...
متن کاملJust-In-Time Compilers and Dynamic Code Generation
• Partial Evaluation (Run-Time Specialization) Proposed as a way to speed up selected pieces of code. Some function arguments may be known to be (almost) constant at run-time. A specialized (partially evaluated) version of those functions can be generated dynamically, and will hopefully execute faster than the general version. Some of the work done in this area includes: Auslander’s extensions ...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 1996